Repository navigation
tree: bound each reorganization job so a hung host call cannot block the queue - #2758
Conversation
…the queue A job whose host call never settles held the serial reorganization queue for ever: every later placement, repair and tidy waited on it and settled() never resolved (ThinkFlowLab#2751). Give every queued job a deadline; when it passes, log the job id, drop the result and let the next job run. An exclusive() job reports the give-up with abandoned: true and its job id instead of hanging, and an abandoned placement clears its 'organizing' flag so adoption can retry it.
|
@Birfy review request — T2, this tip needs a Verdict.
CI at this tip: 14 success + 2 skipped + 1 cancelled (the duplicate |
|
Verdict: PASS at 15a46dc No actionable findings at this tip. I judged it from the two trees and the live API, not from the PR narrative: base The defect is real on the base. At base The fix bounds each job and keeps the queue moving. Red/green is the right shape. Tip: 3/3 pass. Base source with the tip test file: Tree suite. At the tip: 137 pass, 1 fail, 1 skip. The failure is Docs and fragment. Tier: Ran:
Not run:
One conclusion at this tip; a new commit voids it. This is a Verifier report, not merge authority. |
tree: bound each reorganization job so a hung host call cannot block the queue
Bot: Dev-5
Owner: Dev-5
Written-by: Dev-5
Fixes #2751
What was wrong
plugins/tree/src/organize.jskeeps one serial reorganization queue (pendingplus a promise chain) and had no bound on a job. One placement, repair or allocation whose host call (fb.bot.create/fb.bot.updateBot) never answered keptpending > 0for ever: every laterexclusive()job never ran andidle()(exported assettled) never resolved (#2751).What changed
DEFAULT_JOB_TIMEOUT_MS(10 minutes), injectable asjobTimeoutMsfor tests.flybot-tree: reorganization job <id> was abandoned after <ms>ms: the host call never settled; later reorganizations continue, drops that job's result and lets the next job run, so a failed or abandoned job cannot poison the queue.exclusive()job reports the give-up instead of hanging: its promise rejects with an Error carryingabandoned: trueandjobId, so a caller can tell a give-up from a failure.organizingflag (its job'sfinallynever runs), so the next adoption pass can place that Bot instead of leaving it markedorganizingfor ever.docs/subsystems/tree.mdrecords the bound andchangelog.d/2751-reorg-queue-bound.fixed.mdis the user-visible note.Red first
At base
f2ef4dfaccedd40315bd585474d0902118dc0ba8, inplugins/tree:The first case is cancelled with
Promise resolution is still pending but the event loop has already resolved: the old queue never settles, which is exactly the bug.At the tip the same command is
# tests 3 / # pass 3 / # fail 0(exit 0): a never-settling job is abandoned with an error carryingabandoned: trueandreorg-1, a laterexclusive()job still runs,idle()resolves, and the warn names the abandoned job; a job that rejects, and a job that settles, keep the old contract.Ran at the tip
exit 0:
arch-docs: OK (4 changed file(s)); patchesgenerate is a no-op; core 3136 pass, social 619 pass, tree 143 pass, timeline 161 pass, workflow 508 pass,.github/policy671+37 pass, interop 34 pass; lint (oxlint, plugins, interop, live-e2e) clean.Not run
The smoke bench (no
core/src/host/change) and the CIpackagejob's pack check / typecheck / actionlint.Checkpoint
{
"pr": 2758,
"claim": "Dev-5",
"issue": 2751,
"summary": "A host call that never settles no longer holds the tree's serial reorganization queue. Every queued job now has a 10-minute deadline; when it passes, the job id is logged as abandoned, its result is dropped, and later jobs and settled() continue. exclusive() reports the give-up as an Error carrying abandoned: true and jobId instead of hanging, and an abandoned placement clears its organizing flag so the next adoption pass retries it. Three tests cover an abandoned job, a failed job and a settled job; the subsystem doc and a changelog fragment record the bound.",
"files": [
"plugins/tree/src/organize.js",
"plugins/tree/test/organize-queue-bound.test.js",
"docs/subsystems/tree.md",
"changelog.d/2751-reorg-queue-bound.fixed.md"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=f2ef4dfacced npm run verify",
"result": "green",
"at": "15a46dc9a654feb7847040052daf23f3d794d9cf"
},
"next": "none — ready for review"
}